/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gestionedf;

import java.io.*;
import gnu.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import java.lang.*;
import java.sql.*;
import java.util.Enumeration;

/**
 *
 * @author Dna
 */
public class FRAME_MAIN extends javax.swing.JFrame {

    /**
     * Creates new form FRAME_MAIN
     */
    public FRAME_MAIN() {
        initComponents();
        Enumeration listePort = CommPortIdentifier.getPortIdentifiers();
        CommPortIdentifier portId2;
        portId2 = (CommPortIdentifier) listePort.nextElement();
        String port = portId2.getName();
        //récupération de l'identifiant du port
        try {
            portId = CommPortIdentifier.getPortIdentifier(port);
        } catch (NoSuchPortException e) {
        }
        //ouverture du port
        try {
            sPort = (SerialPort) portId.open("UtilisationFlux", 30000);
        } catch (PortInUseException e) {
        }
        //règle les paramètres de la connexion
        try {
            sPort.setSerialPortParams(
                    1200,
                    SerialPort.DATABITS_7,
                    SerialPort.STOPBITS_1,
                    SerialPort.PARITY_ODD);
        } catch (UnsupportedCommOperationException e) {
        }
        //récupération du flux de lecture et écriture du port
        try {
            outStream = sPort.getOutputStream();
            bufRead =
                    new BufferedReader(
                    new InputStreamReader(sPort.getInputStream()));
        } catch (IOException e) {
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        canvas1 = new java.awt.Canvas();
        jPanel1 = new javax.swing.JPanel();
        TXT_IINST3 = new javax.swing.JLabel();
        TXT_PPOT = new javax.swing.JLabel();
        TXT_IMAX3 = new javax.swing.JLabel();
        TXT_HHPHC = new javax.swing.JLabel();
        TXT_ADCO = new javax.swing.JLabel();
        TXT_PAPP = new javax.swing.JLabel();
        TXT_ISOUSC = new javax.swing.JLabel();
        TXT_HCHP = new javax.swing.JLabel();
        TXT_IMAX1 = new javax.swing.JLabel();
        TXT_PMAX = new javax.swing.JLabel();
        TXT_HCHC = new javax.swing.JLabel();
        TXT_MOTDETAT = new javax.swing.JLabel();
        TXT_IINST2 = new javax.swing.JLabel();
        TXT_IMAX2 = new javax.swing.JLabel();
        TXT_OPTARIF = new javax.swing.JLabel();
        TXT_IINST1 = new javax.swing.JLabel();
        TXT_PTEC = new javax.swing.JLabel();
        textArea1 = new java.awt.TextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setPreferredSize(new java.awt.Dimension(999, 500));
        setResizable(false);

        jPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        TXT_IINST3.setText("Intensité instantanée 3");

        TXT_PPOT.setText("Présence des potentiels");

        TXT_IMAX3.setText("Intensité maximale 3");

        TXT_HHPHC.setText("Horaire Heures Pleines / Heures Creuses");

        TXT_ADCO.setText("Adresse compteur ");

        TXT_PAPP.setText("Puissance apparente triphasée");

        TXT_ISOUSC.setText("Intensité souscrite");

        TXT_HCHP.setText("Heures Pleines ");

        TXT_IMAX1.setText("Intensité maximale 1");

        TXT_PMAX.setText("Puissance maximale triphasée");

        TXT_HCHC.setText("Heures Creuses");

        TXT_MOTDETAT.setText("Mot d'état compteur");

        TXT_IINST2.setText("Intensité instantanée 2");

        TXT_IMAX2.setText("Intensité maximale 2");

        TXT_OPTARIF.setText("Option tarifaire");

        TXT_IINST1.setText("Intensité instantanée 1");

        TXT_PTEC.setText("Période tarifaire en cours ");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(TXT_ADCO)
                    .addComponent(TXT_OPTARIF)
                    .addComponent(TXT_ISOUSC)
                    .addComponent(TXT_HCHC)
                    .addComponent(TXT_HCHP)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(TXT_IINST1)
                        .addComponent(TXT_IINST3))
                    .addComponent(TXT_PTEC)
                    .addComponent(TXT_IINST2)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(TXT_IMAX1)
                        .addComponent(TXT_IMAX2)
                        .addComponent(TXT_IMAX3))
                    .addComponent(TXT_PAPP)
                    .addComponent(TXT_PMAX)
                    .addComponent(TXT_HHPHC)
                    .addComponent(TXT_MOTDETAT)
                    .addComponent(TXT_PPOT))
                .addContainerGap(203, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(TXT_ADCO)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TXT_OPTARIF)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TXT_ISOUSC)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TXT_HCHC)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TXT_HCHP)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TXT_PTEC)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TXT_IINST1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TXT_IINST2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TXT_IINST3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TXT_IMAX1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TXT_IMAX2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TXT_IMAX3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TXT_PMAX)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TXT_PAPP)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TXT_HHPHC)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TXT_MOTDETAT)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(TXT_PPOT)
                .addContainerGap())
        );

        textArea1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        textArea1.setEditable(false);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(textArea1, javax.swing.GroupLayout.PREFERRED_SIZE, 295, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(textArea1, javax.swing.GroupLayout.PREFERRED_SIZE, 414, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public void EnvoiTrame(String str) {
        try {
            outStream.write(str.getBytes());
        } catch (IOException e) {
            System.out.print(e.toString());
        }
    }

    public int LectureTrame() {
        int retour = 0;
        try {
            retour = bufRead.read();
        } catch (IOException e) {
            //System.out.print(e.toString());
        }
        return retour;
    }

    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FRAME_MAIN.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FRAME_MAIN.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FRAME_MAIN.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FRAME_MAIN.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @SuppressWarnings("WaitWhileNotSynced")
            public void run() 
            {
//                FRAME_MAIN fn = new FRAME_MAIN();//.setVisible(true);
//                fn.setVisible(true);
//                try {
//                    fn.wait(5000);
//                    fn.fonction();
//                } catch (InterruptedException ex) {
//                    System.out.print(ex.toString());
//                    Logger.getLogger(FRAME_MAIN.class.getName()).log(Level.SEVERE, null, ex);
//                }
                


            }
        });
    }

    public void Select(String requete) {
        // film est le nom de la BD
        String query = requete; // une requeteSQL
        Statement stmt;
        try {
            mySQLDriver = new org.gjt.mm.mysql.Driver();
            con = DriverManager.getConnection(url, "o", "ol");
            // o est le login du user et ol, le mot de passe
            System.out.println("Con = " + con);
            stmt = con.createStatement();
            ResultSet rs = stmt.executeQuery(query);
            while (rs.next()) {
                System.out.println(rs.getString(1));
            }
            stmt.close();
            con.close();
        } catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
        }
    }
    
    public void fonction()
    {                                          
        try {
            while (bufRead.ready()) {
                Trame = new char[10000];
                bufRead.read(Trame);
                //Chaine+=(char)this.LectureTrame();
                //this.jTextArea1.setText(Chaine);
            }
        } catch (IOException ex) {
            Logger.getLogger(FRAME_MAIN.class.getName()).log(Level.SEVERE, null, ex);
        }
        int debut = 0, fin = 0;
        for (int i = 0; i < Trame.length - 1; i++) {
            if (Trame[i] == 0x02) {
                //JOptionPane.showMessageDialog(this, i+"STX");
                debut = i;
                break;
            }
            //JOptionPane.showMessageDialog(this,Trame.toString().substring(debut,fin));               
        }
        for (int i = debut; i < Trame.length - 1; i++) {
            if (Trame[i] == 0x03) {
                //JOptionPane.showMessageDialog(this, i+"END");
                fin = i;
                break;
            }
        }
        //JOptionPane.showMessageDialog(this,Trame.toString().substring(debut,fin));
        Chaine = "";
        for (int i = debut + 1; i < fin; i++) {
            Chaine += Trame[i];
            System.out.print(Trame[i]);
        }
        //########################################################################
        //#                            Calcul des OFFSET                         #
        //########################################################################

        int ADCO_D = Chaine.indexOf("ADCO");
        int OPTARIF_D = Chaine.indexOf("OPTARIF");
        int ISOUSC_D = Chaine.indexOf("ISOUSC");
        int HCHC_D = Chaine.indexOf("HCHC");
        int HCHP_D = Chaine.indexOf("HCHP");
        int PTEC_D = Chaine.indexOf("PTEC");
        int IINST1_D = Chaine.indexOf("IINST1");
        int IINST2_D = Chaine.indexOf("IINST2");
        int IINST3_D = Chaine.indexOf("IINST3");
        int IMAX1_D = Chaine.indexOf("IMAX1");
        int IMAX2_D = Chaine.indexOf("IMAX2");
        int IMAX3_D = Chaine.indexOf("IMAX3");
        int PMAX_D = Chaine.indexOf("PMAX");
        int PAPP_D = Chaine.indexOf("PAPP");
        int HHPHC_D = Chaine.indexOf("HHPHC");
        int MOTDETAT_D = Chaine.indexOf("MOTDETAT");
        int PPOT_D = Chaine.indexOf("PPOT");
        int ADCO_F = Chaine.indexOf(0x0D, Chaine.indexOf("ADCO"));
        int OPTARIF_F = Chaine.indexOf(0x0D, Chaine.indexOf("OPTARIF"));
        int ISOUSC_F = Chaine.indexOf(0x0D, Chaine.indexOf("ISOUSC"));
        int HCHC_F = Chaine.indexOf(0x0D, Chaine.indexOf("HCHC"));
        int HCHP_F = Chaine.indexOf(0x0D, Chaine.indexOf("HCHP"));
        int PTEC_F = Chaine.indexOf(0x0D, Chaine.indexOf("PTEC"));
        int IINST1_F = Chaine.indexOf(0x0D, Chaine.indexOf("IINST1"));
        int IINST2_F = Chaine.indexOf(0x0D, Chaine.indexOf("IINST2"));
        int IINST3_F = Chaine.indexOf(0x0D, Chaine.indexOf("IINST3"));
        int IMAX1_F = Chaine.indexOf(0x0D, Chaine.indexOf("IMAX1"));
        int IMAX2_F = Chaine.indexOf(0x0D, Chaine.indexOf("IMAX2"));
        int IMAX3_F = Chaine.indexOf(0x0D, Chaine.indexOf("IMAX3"));
        int PMAX_F = Chaine.indexOf(0x0D, Chaine.indexOf("PMAX"));
        int PAPP_F = Chaine.indexOf(0x0D, Chaine.indexOf("PAPP"));
        int HHPHC_F = Chaine.indexOf(0x0D, Chaine.indexOf("HHPHC"));
        int MOTDETAT_F = Chaine.indexOf(0x0D, Chaine.indexOf("MOTDETAT"));
        int PPOT_F = Chaine.indexOf(0x0D, Chaine.indexOf("PPOT"));

        //########################################################################################################
        //#                                      Affichage des Valeurs                                           #
        //########################################################################################################

        this.TXT_ADCO.setText("Adresse compteur :"  + " " + Chaine.substring(ADCO_D + 5, ADCO_F - 1));
        String OPTARIF = Chaine.substring(OPTARIF_D + 7, OPTARIF_F - 1);
        switch(OPTARIF.trim())
        {
            case "BASE":
                this.TXT_OPTARIF.setText("Option tarifaire :" + " BASE");
                break;
            case "HC..":
                this.TXT_OPTARIF.setText("Option tarifaire :" + " Heures Creuses / Heures Pleines");
                break;
            case "EJP.":
                this.TXT_OPTARIF.setText("Option tarifaire :" + " Effacement des Jours de Pointe");
                break;
            case "BBRX":
                this.TXT_OPTARIF.setText("Option tarifaire :" + " Tempo");
                break;
        }
        
        String ISOUSC = Chaine.substring(ISOUSC_D + 6, ISOUSC_F - 1);
        switch (ISOUSC.trim()) {
            case "10":
                this.TXT_ISOUSC.setText("Intensité souscrite :"+" 10 A - 06 kVA");
                break;
            case "15":
                this.TXT_ISOUSC.setText("Intensité souscrite :"+" 15 A - 09 kVA");
                break;
            case "20":
                this.TXT_ISOUSC.setText("Intensité souscrite :"+" 20 A - 12 kVA");
                break;
            case "25":
                this.TXT_ISOUSC.setText("Intensité souscrite :"+" 25 A - 15kVA");
                break;    
            case "30":
                this.TXT_ISOUSC.setText("Intensité souscrite :"+" 30 A - 18 kVA");
                break;
            case "40":
                this.TXT_ISOUSC.setText("Intensité souscrite :"+" 40 A - 24 kVA");
                break;
            case "50":
                this.TXT_ISOUSC.setText("Intensité souscrite :"+" 50 A - 30 kVA");
                break;
            case "60":
                this.TXT_ISOUSC.setText("Intensité souscrite :"+" 60 A - 36 kVA");
                break;
        }
        this.TXT_HCHC.setText("Heures Creuses :" + " " + Chaine.substring(HCHC_D + 4, HCHC_F - 1));
        this.TXT_HCHP.setText("Heures Pleines :" + " " + Chaine.substring(HCHP_D + 4, HCHP_F - 1));
        this.textArea1.append(Chaine.substring(HCHP_D + 4, HCHP_F - 1).trim()+"\n");
        String PTEC = Chaine.substring(PTEC_D + 4, PTEC_F - 1);
        switch(PTEC.trim())
        {
             case "TH..":
                 this.TXT_PTEC.setText("Période tarifaire en cours :" + " " +"Toutes Heures");
                 break;
             
             case "HC..":                 
                 this.TXT_PTEC.setText("Période tarifaire en cours :" + " " +"Heures Creuses");
                 break;
                
            case "HP..":
                this.TXT_PTEC.setText("Période tarifaire en cours :" + " " +" Pleines");
                break;
            case "HN..":
                this.TXT_PTEC.setText("Période tarifaire en cours :" + " " +" Normales");
                break;
            case "PM..":
                this.TXT_PTEC.setText("Période tarifaire en cours :" + " " +"Pointe Mobile");
                break;
            case "HCJB":
                this.TXT_PTEC.setText("Période tarifaire en cours :" + " " +" Creuses Jours Bleus");
                break;
            case "HPJB":
                this.TXT_PTEC.setText("Période tarifaire en cours :" + " " +" Pleines Jours Bleus");
                break;
            case "HCJW":
                this.TXT_PTEC.setText("Période tarifaire en cours :" + " " +" Creuses Jours Blancs");
                break;
            case "HPJW":
                this.TXT_PTEC.setText("Période tarifaire en cours :" + " " +" Pleines Jours Blancs");
                break;
            case "HCJR":
                this.TXT_PTEC.setText("Période tarifaire en cours :" + " " +" Creuses Jours Rouges");
                break;
            case "HPJR":
                this.TXT_PTEC.setText("Période tarifaire en cours :" + " " +" Pleines Jours Rouges");
                break;
        }
        //this.TXT_PTEC.setText("Période tarifaire en cours :" + " " + Chaine.substring(PTEC_D + 4, PTEC_F - 1));
        
        this.TXT_IINST1.setText("Intensité instantanée 1 :" + " " + Chaine.substring(IINST1_D + 6, IINST1_F - 1));
        this.TXT_IINST2.setText("Intensité instantanée 2 :" + " " + Chaine.substring(IINST2_D + 6, IINST2_F - 1));
        this.TXT_IINST3.setText("Intensité instantanée 3 :" + " " + Chaine.substring(IINST3_D + 6, IINST3_F - 1));
        this.TXT_IMAX1.setText("Intensité maximale 1 :" + " " + Chaine.substring(IMAX1_D + 5, IMAX1_F - 1));
        this.TXT_IMAX2.setText("Intensité maximale 2 :" + " " + Chaine.substring(IMAX2_D + 5, IMAX2_F - 1));
        this.TXT_IMAX3.setText("Intensité maximale 3 :" + " " + Chaine.substring(IMAX3_D + 5, IMAX3_F - 1));
        this.TXT_PMAX.setText("Puissance maximale triphasée :" + " " + Chaine.substring(PMAX_D + 4, PMAX_F - 1));
        this.TXT_PAPP.setText("Puissance apparente triphasée :" + " " + Chaine.substring(PAPP_D + 4, PAPP_F - 1));
        this.TXT_HHPHC.setText("Horaire Heures Pleines / Heures Creuses :" + " " + Chaine.substring(HHPHC_D + 5, HHPHC_F - 1));
        this.TXT_MOTDETAT.setText("Mot d'état compteur :" + " " + Chaine.substring(MOTDETAT_D + 7, MOTDETAT_F - 1));
        this.TXT_PPOT.setText("Présence des potentiels :" + " " + Chaine.substring(PPOT_D + 4, PPOT_F - 1));

        //this.jTextArea1.setText(Chaine);

    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel TXT_ADCO;
    private javax.swing.JLabel TXT_HCHC;
    private javax.swing.JLabel TXT_HCHP;
    private javax.swing.JLabel TXT_HHPHC;
    private javax.swing.JLabel TXT_IINST1;
    private javax.swing.JLabel TXT_IINST2;
    private javax.swing.JLabel TXT_IINST3;
    private javax.swing.JLabel TXT_IMAX1;
    private javax.swing.JLabel TXT_IMAX2;
    private javax.swing.JLabel TXT_IMAX3;
    private javax.swing.JLabel TXT_ISOUSC;
    private javax.swing.JLabel TXT_MOTDETAT;
    private javax.swing.JLabel TXT_OPTARIF;
    private javax.swing.JLabel TXT_PAPP;
    private javax.swing.JLabel TXT_PMAX;
    private javax.swing.JLabel TXT_PPOT;
    private javax.swing.JLabel TXT_PTEC;
    private java.awt.Canvas canvas1;
    private javax.swing.JPanel jPanel1;
    private java.awt.TextArea textArea1;
    // End of variables declaration//GEN-END:variables
    private BufferedReader bufRead; //flux de lecture du port
    private OutputStream outStream; //flux d'écriture du port
    private CommPortIdentifier portId; //identifiant du port
    private SerialPort sPort; //le port série
    private String Chaine;
    private char[] Trame;
    // Variable Pour le MYSQL
    private String url = "jdbc:mysql://localhost:3306/film";
    private Connection con;
    private Driver mySQLDriver;
}
